<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>
<%@ include file="/commons/dateTime.jsp" %>
<%@ include file="/commons/validation.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>验房</title>
<script language="JavaScript" src="${ctx}/scripts/common/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script type="text/javascript">
var flag = 0;
function addHouseValidate(){
    if(window.frames["meterDateList"].validateInput()){
		return false;
	}
    setMeterDate();
	var isTrue=$('houseValidateForm').fireEvent("onSubmit") ;
    if(isTrue){
        var param = Form.serialize('houseValidateForm');
        var url="${ctx}/occupation_joinHandleAction.do?method=editHouseValidate&optType=${optType}";
        new Ajax.Request(url,{method: 'post',parameters :param ,onSuccess : showResult});
	}
}
function showResult(response){
    ajaxSubmitException(response.responseText);
	var obj=findFrame('houseValidate');
	obj.reloadHouseValidateList();
	windowClose();
}
function setMeterDate(){
	$('meterCardinalStr').value = window.frames["meterDateList"].buildStr();
}
function init(){
    $('idsub').disabled = false;
	var radios = document.getElementsByName('checkResult');
	for(var i = 0 ; i < radios.length ; i++)
	{
		if('${inspectRequisite.checkResult }' == radios[i].value)
		{
		   radios[i].checked = true;
		   break;
		}
	}
	$('meterDateList').src=encodeURI(encodeURI("${ctx}/occupation_joinHandleAction.do?method=initMeterDataList&inspecteId=${inspectRequisite.keyword }&houseIds=${houseIds}&coalitionHouseNumber=${coalitionHouseNumber }&optType=${optType }"));
}
function setFlag(){
  flag = flag+1;
}
</script>
</head>
<body onload="init()">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle" /> <span class="window_head_intext">验房登记</span></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td valign="middle" class="content"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="container_in_show">
      <tr>
        <td valign="top"><div id="tab_Search" style="height:380px;overflow:auto;" >
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" id="tab_subMenu1">
                  <tr>
                    <td><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
                        <tr>
                          <td>
                          <form action="#" name="houseValidateForm" method="post" class="required-validate">
                          <input type="hidden" name="meterCardinalStr">
                          <input type="hidden" name="keyword" value="${inspectRequisite.keyword }">
                          <input type="hidden" name="identityValidateId" value="${inspectRequisite.identityValidateId }">
                          <table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color" >
                              <tr>
                                <td class="aux_intable_td1">房 号：</td>
                                <td class="aux_intable_td2">${houseNumbers }</td>
                                <td class="aux_intable_td1">验收人：</td>
                                <td class="aux_intable_require">
                                <pms:unitedSelect id="checkMan"
									name="checkMan" dataList="${handoverList}"
									value="${inspectRequisite.checkMan }"
							 		optionLabel="participantName"
							 		className="select-one-required"
									optionValue="participantName">
								</pms:unitedSelect>
                               </td>
                              </tr>
                              <tr>
                                <td class="aux_intable_td1">管理房号：</td>
                                <td class="aux_intable_td2">${coalitionHouseNumber }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	                            <c:if test="${identityValidate.joinMode eq '002' }">
					                   按管理房办理
					             </c:if></td>
                                <td class="aux_intable_td1">验收日期：</td>
                                <td class="aux_intable_require"><table border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td><input name="checkDate" type="text"
                                                class="required validate-date-yyyy-MM-dd validate-ajax" replaceId="dataValue"
                   			  					validateUrl="${ctx}/common_sysrefcodeAction.do?method=compareCurrentDate&dateFormat=yyyy-MM-dd&compareType=smallEqualsCurrentDate" validateMessage="输入的验收日期必须小于等于当前系统时间"
                                                value="<fmt:formatDate value='${inspectRequisite.checkDate}' pattern='yyyy-MM-dd'/>"
                                                size="16" maxlength="10" afterInsert="dateAfter"/></td>
                                      <td width="4">&nbsp;</td>
                                      <td><img name="checkDateButton" src="${ctx}/images/ico_clock.gif" width="20" height="20" /><span id="dateAfter"></span></td>
                                    </tr>
                                </table></td>
                              </tr>
                              <tr>
                                <td class="aux_intable_td1">验房员：</td>
                                <td class="aux_intable_require"><input name="proveMan" type="text" class="required validate-char" value="${inspectRequisite.proveMan }" size="16" maxlength="50"/></td>
                                <td class="aux_intable_td1">&nbsp;</td>
                                <td class="aux_intable_td2">&nbsp;</td>
                              </tr>
                              <tr>
                                <td colspan="4" class="aux_titletable">验房结果</td>
                              </tr>
                              <tr>
                                <td  colspan="2"class="aux_intable_td1">经检查所购房屋的建筑质量： </td>
                                <td colspan="2" class="aux_intable_require">
                                <input type="radio" name="checkResult"  value="1" class="validate-one-required"/>
                                  通 过&nbsp;　&nbsp;　
                                  <input type="radio" name="checkResult" value="0" class="validate-one-required" />
                                  不通过</td>
                              </tr>
                              <tr>
                                <td  colspan="4"class="aux_titletable">整改项目</td>
                                </tr>
                              <tr>
                                <td  colspan="4"class="aux_intable_td1"><table width="100%" border="0" cellpadding="0" cellspacing="0" id="table02">
                                  <tr>
                                    <td colspan="4">
                                    	<iframe src="${ctx}/occupation_joinHandleAction.do?method=initRectificateMain&inspecteRequisteId=${inspectRequisite.keyword }&identityValidateId=${inspectRequisite.identityValidateId }" name="rectificateMain" id="rectificateMain" width="100%" height="200px" frameborder="0" scrolling="auto" onLoad="setFlag()"> </iframe>
                                    </td>
                                  </tr>
                                </table></td>
                                </tr>
                              <tr>
                                <td  colspan="4"class="aux_titletable">走表底数抄表</td>
                                </tr>
                              <tr>
                                <td  colspan="4"class="aux_intable_td1">
                                  <iframe  src="" name="meterDateList" id="meterDateList" width="100%" height="200px" frameborder="0" scrolling="auto" onLoad="setFlag()"> </iframe>
                                </td>
                                </tr>
                            </table>
                            </form>
                            </td>
                        </tr>
                    </table></td>
                  </tr>
              </table></td>
            </tr>
          </table>
        </div></td>
        </tr>
       </table></td>
  </tr>
<tr>
    <td class="window_footer"><table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;</td>
          <td class="btn_between_space"></td>
          <td><table id="idsub" border="0" cellpadding="0" cellspacing="0" onclick="addHouseValidate()" >
            <tr>
              <td class="buttonOffLeft" id="btn1_51"></td>
              <td class="buttonOffMiddle" id="btn1_52" onblur="btn_change(5)" onMouseOver="btn_change_over(5)" onMouseOut="btn_change_out(5)" ><img src="${ctx}/images/ico_ok.gif" border="0" align="absmiddle"/> 保 存</td>
              <td class="buttonOffRight" id="btn1_53"></td>
            </tr>
        </table></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0" onClick="windowClose();">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onblur="btn_change(3)" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)"><img src="${ctx}/images/ico_cancel.gif" border="0" align="absmiddle" /> 关 闭</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table>
	</td>
</tr>
</table>
<script type="text/javascript">
Calendar.setup(
              {
	              inputField : "checkDate", // ID of the input field
	              ifFormat : "%Y-%m-%d", // the date format
	              button : "checkDateButton", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true
              }
              );
</script>
</body>
</html>